<template>
  <div class="MyHeader">
    <!-- 头部 -->
    <van-row class="My_header">
      <van-col span="5">
        <img :src="userInfo.headImg" />
      </van-col>
      <van-col span="19">
        <h4>{{ userInfo.nickname }}</h4>
        <p v-if="userInfo.grade == 0">普通用户</p>
        <p v-if="userInfo.grade == 1">黄金会员</p>
        <p v-if="userInfo.grade == 2">白金会员</p>
        <p v-if="userInfo.grade == 3">钻石会员</p>
        <span v-if="userInfo.grade != 0">有效期：{{
          $common.getExactTime(userInfo.expTime)
        }}</span>
      </van-col>
    </van-row>
  </div>
</template>

<script lang="ts">
import { Vue, Component, Prop } from "vue-property-decorator";
import { Col, Row } from "vant";

Vue.use(Col);
Vue.use(Row);
@Component({})
export default class MyHeader extends Vue {
  @Prop() userInfo?: { headImg: ""; nickname: "" };
}
</script>

<style lang="scss" scoped>
.MyHeader {
  width: 100%;
  box-sizing: border-box;
  & > .My_header {
    width: 100%;
    padding: 30px;
    box-sizing: border-box;
    background-color: #fff;
    img {
      width: 126px;
      height: 126px;
      display: block;
      border-radius: 100%;
    }
    h4 {
      font-size: 36px;
      font-weight: 400;
      color: #0c0c0c;
      line-height: 1.5;
    }
    p {
      font-size: 24px;
      font-weight: 400;
      color: #e9c790;
      line-height: 2;
    }
  }
}
</style>